package many_thread;

import java.util.concurrent.Callable;

public class MyCallable implements Callable<Integer> {
    private String name;

    public MyCallable(String name) {
        this.name = name;
    }

    public MyCallable(){}

    @Override
    public Integer call() throws Exception {
        int sum = 0;
        for (int i = 1; i <= 50; i++) {
            System.out.println(this.name + "-" + i);
            sum += i;
        }
        return sum;
    }
}
